let express = require('express');
let router = express.Router();
let Goods = require("../model/goods");
let User = require("../model/user");

//我的发布
router.get('/', (req, res) => {
    Goods
        .find({})
        .populate({
            path: 'userId', 
            select: '-openId'
        })
        .sort({'createTime':-1})
        .exec(function(err, goodsList){
            if(err){
                console.log(err);
            }
            res.json({
                goodsList: goodsList
            }) 
        })
})

module.exports = router;